<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
	<HTML>
	<HEAD>
	<TITLE>List <xsl:value-of select="ROOT/TOPICLIST/@TYPE" /></TITLE>
	
	<STYLE TYPE="text/css"><xsl:comment>
	BODY {
		font-family: 宋体;
		font-size: 12px;
		border-style: dotted;
		border-color: #d7d7d7;
		border-width: thin;
	}

	UL {
		margin-left: 0px;
		margin-bottom: 3px;
		margin-right: 0px;
		margin-top: 0px;
	}

	LI UL {
		display: none;
		margin-left: 15px;
	}

	LI {
		COLOR: #000066;
		list-style-type: square;
		cursor: default;
		font-weight: 400;
		margin-top: 3px;
	}

	LI.clsHasKids {
		font-weight: bold;
		list-style-type: none;
		COLOR: #bf0000;
		CURSOR: HAND;
	}

	</xsl:comment></STYLE>

	<SCRIPT LANGUAGE="javascript"><xsl:comment><![CDATA[
	function GetChildElem(eSrc,sTagName)
	{
    	var cKids = eSrc.children;
		for (var i=0;i<cKids.length;i++)
	    {
      		if (sTagName == cKids[i].tagName) return cKids[i];
	    }
    	return false;
	}

	function document.onclick()
	{
    	var eSrc = window.event.srcElement;
	    if ("clsHasKids" == eSrc.className && (eChild = GetChildElem(eSrc,"UL")))
    	{
			eChild.style.display = ("block" == eChild.style.display ? "none" : "block");
	    }
	}

	function ShowAll(sTagName)
	{
    	var cElems = document.all.tags(sTagName);
	    var iNumElems = cElems.length;
	    for (var i=1;i<iNumElems;i++) cElems[i].style.display = "block";
	}

	function HideAll(sTagName)
	{
		var cElems = document.all.tags(sTagName);
		var iNumElems = cElems.length;
		for (var i=1;i<iNumElems;i++) cElems[i].style.display = "none";
  	}
	]]>//</xsl:comment></SCRIPT>	

	</HEAD>
	<BODY onload="ShowAll('UL')">
	<!--BUTTON ONCLICK="ShowAll('UL')">显示全部</BUTTON-->
	<!--BUTTON ONCLICK="HideAll('UL')">隐藏全部</BUTTON-->
	<!--H1>List <xsl:value-of select="TOPICLIST/@TYPE" /></H1-->
	<UL><xsl:apply-templates select="ROOT/TOPICLIST/TOPICS" />	</UL>
	<!--P><BUTTON ONCLICK="window.alert(document.body.innerHTML);">查看 HTML</BUTTON></P-->
	</BODY>
	</HTML>
</xsl:template>

<xsl:template match="TOPICS">
	<LI CLASS="clsHasKids"><xsl:value-of select="@TYPE" />
	<UL>
	<xsl:for-each select="TOPIC">
		<LI>
				<xsl:value-of select="TITLE" />
		</LI>
	</xsl:for-each>
	<xsl:if test="TOPICS"><xsl:apply-templates /></xsl:if>
	</UL>
	</LI>
</xsl:template>

</xsl:stylesheet>